<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
		<script src="js/common.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
	</body>

</html>

<script type="text/javascript">

	var view = {

		init() {
			this.render();
		},
		
		render() {
			var url = 'https://www.easy-mock.com/mock/5b67edb475d70b78bbc6212e/xinyan/getFoodList';
			var data = {
				type: 'fruit'
			};
			var result = ajax(url, data);
			
			result.then((res)=> {
				console.log(res);
			}).catch((err)=> {
				console.log(err);
			})
		}
	}
	
	view.init();
</script>